﻿using Microsoft.AspNetCore.Http;
using System;
using System.Threading.Tasks;
using xycn.pluginsupport.AspNetCorePlugins;

namespace test_midareplugin
{
    public class testMidwareClas2
    {
        [AspNetMidware(3)]
        public async Task asdfasdf3(HttpContext context, Func<Task> next)
        {
            System.Console.WriteLine("class2 no context call midware3");
            await next.Invoke();
        }

        [AspNetMidware(2)]
        public async Task asdfasdf2(HttpContext context, Func<Task> next)
        {
            System.Console.WriteLine("class2 call midware2");
            await next.Invoke();
        }

        [AspNetMidware(1)]
        public async Task asdfasdf(Microsoft.AspNetCore.Http.HttpContext context, Func<Task> next)
        {
            System.Console.WriteLine("class2 call midware");
            await next.Invoke();
        }

        [AspNetMidware(100)]
        public async Task asdfasdf4(HttpContext context, Func<Task> next)
        {
            System.Console.WriteLine("class2 call midware100");
            await next.Invoke();
        }

        [AspNetMidware(101)]
        public async Task asdfasdf5(Microsoft.AspNetCore.Http.HttpContext context, Func<Task> next)
        {
            System.Console.WriteLine("class2 call midware101");
            await next.Invoke();
        }

        [AspNetMidware(95)]
        public async Task asdfasdf6(HttpContext context, Func<Task> next)
        {
            System.Console.WriteLine("class2 call midware95");
            await next.Invoke();
        }
    }

    public class HttpContext 
    {
        public int x;
    }
}
